<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta
            http-equiv="Content-Type"
            content="text/html; charset=utf-8"
        />
        <meta name="viewport" content="width=device-width, initial-scale=1" />

        <title>Migration Guide &mdash; Python Slack SDK</title>

        <!-- Google Tag Manager -->
        <script>
            (function(w, d, s, l, i) {
                w[l] = w[l] || [];
                w[l].push({
                    'gtm.start': new Date().getTime(),
                    event: 'gtm.js'
                });
                var f = d.getElementsByTagName(s)[0],
                    j = d.createElement(s),
                    dl = l != 'dataLayer' ? '&l=' + l : '';
                j.async = true;
                j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
                f.parentNode.insertBefore(j, f);
            })(window, document, 'script', 'dataLayer', 'GTM-KFZ5MK7');
        </script>
        <!-- End Google Tag Manager -->
        
        <link
            href="https://a.slack-edge.com/4f227/style/rollup-slack_kit_legacy_adapters.css"
            rel="stylesheet"
            type="text/css"
        />
        <link
            href="https://a.slack-edge.com/3e02c0/style/rollup-api_site.css"
            rel="stylesheet"
            type="text/css"
        />
        <link
            rel="stylesheet"
            href=".././assets/default.css"
            type="text/css"
        />
        <link
            rel="stylesheet"
            href=".././assets/pygments.css"
            type="text/css"
        />
        <link
            rel="stylesheet"
            href=".././assets/docs.css"
            type="text/css"
        />
        <link
            id="favicon"
            rel="shortcut icon"
            href="https://a.slack-edge.com/4f28/img/icons/favicon-32.png"
            type="image/png"
        />
        <link
            rel="top"
            title="Python Slack SDK 1.0.1 documentation"
            href="../index.html"
        />
    </head>

    <body class="api light_theme">
        <!-- Google Tag Manager (noscript) -->
        <noscript
            ><iframe
                src="https://www.googletagmanager.com/ns.html?id=GTM-KFZ5MK7"
                height="0"
                width="0"
                style="display:none;visibility:hidden"
            ></iframe
        ></noscript>
        <!-- End Google Tag Manager (noscript) -->
        <header>
            <a id="menu_toggle" class="no_transition show_on_mobile">
                <span class="menu_icon"></span>
                <span class="vert_divider"></span>
            </a>
            <a
                href="https://api.slack.com/"
                id="header_logo"
                class="api hide_on_mobile"
                style="float:left; display: inline-block;"
            >
                <img
                    alt="Slack API"
                    src="https://a.slack-edge.com/3026cb/img/slack_api_logo_vogue.png"
                    style="width: 225px; padding-right: 25px; border-right: 1px solid #DDD;"
                />
            </a>
            <span
                style="display: inline-block; padding-left: 20px; margin-top: 25px; font-weight: bold;"
            >
                <a style="color: #555459;" href="./index.html">Python Slack SDK</a>
            </span>
            <div class="header_nav">
                <a
                    href="https://github.com/SlackAPI/python-slack-sdk"
                    class="btn header_btn float_right"
                    data-qa="go_to_slack"
                    >Go to GitHub</a
                >
            </div>
        </header>
        

        <div id="page">
            <div id="page_contents" class="clearfix">
                <!-- Sidebar Content -->
                <nav id="api_nav" class="col span_1_of_4">
                    <div id="api_sections">
                         <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../index.html">Python Slack SDK</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Migration Guide</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#from-slackclient-2-x">From slackclient 2.x</a></li>
<li class="toctree-l2"><a class="reference internal" href="#from-slackclient-1-x">From slackclient 1.x</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation/index.html#access-tokens">Access Tokens</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/index.html#workspace-installations">Workspace Installations</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../web/index.html">Web Client</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../web/index.html#messaging">Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="../web/index.html#files">Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="../web/index.html#conversations">Conversations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../web/index.html#modals">Modals</a></li>
<li class="toctree-l2"><a class="reference internal" href="../web/index.html#rate-limits">Rate Limits</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../web/index.html#calling-any-api-methods">Calling any API methods</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../web/index.html#asyncwebclient">AsyncWebClient</a></li>
<li class="toctree-l2"><a class="reference internal" href="../web/index.html#retryhandler">RetryHandler</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../webhook/index.html">Webhook Client</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../webhook/index.html#id1">Incoming Webhooks</a></li>
<li class="toctree-l2"><a class="reference internal" href="../webhook/index.html#response-url">response_url</a></li>
<li class="toctree-l2"><a class="reference internal" href="../webhook/index.html#asyncwebhookclient">AsyncWebhookClient</a></li>
<li class="toctree-l2"><a class="reference internal" href="../webhook/index.html#retryhandler">RetryHandler</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../socket-mode/index.html">Socket Mode Client</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../socket-mode/index.html#socketmodeclient">SocketModeClient</a></li>
<li class="toctree-l2"><a class="reference internal" href="../socket-mode/index.html#supported-libraries">Supported Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../socket-mode/index.html#asyncio-based-libraries">Asyncio Based Libraries</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../oauth/index.html">OAuth Modules</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../oauth/index.html#app-installation-flow">App Installation Flow</a></li>
<li class="toctree-l2"><a class="reference internal" href="../oauth/index.html#token-lookup">Token Lookup</a></li>
<li class="toctree-l2"><a class="reference internal" href="../oauth/index.html#sign-in-with-slack">Sign in with Slack</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../audit-logs/index.html">Audit Logs API Client</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../audit-logs/index.html#auditlogsclient">AuditLogsClient</a></li>
<li class="toctree-l2"><a class="reference internal" href="../audit-logs/index.html#asyncauditlogsclient">AsyncAuditLogsClient</a></li>
<li class="toctree-l2"><a class="reference internal" href="../audit-logs/index.html#retryhandler">RetryHandler</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../scim/index.html">SCIM API Client</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../scim/index.html#scimclient">SCIMClient</a></li>
<li class="toctree-l2"><a class="reference internal" href="../scim/index.html#asyncscimclient">AsyncSCIMClient</a></li>
<li class="toctree-l2"><a class="reference internal" href="../scim/index.html#retryhandler">RetryHandler</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../real_time_messaging.html">RTM Client</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../real_time_messaging.html#real-time-messaging-rtm">Real Time Messaging (RTM)</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../faq.html">FAQ</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../faq.html#python-documents">Python Documents</a></li>
<li class="toctree-l2"><a class="reference internal" href="../faq.html#installation-issues">Installation Issues</a></li>
<li class="toctree-l2"><a class="reference internal" href="../faq.html#bug-report">Bug Report</a></li>
<li class="toctree-l2"><a class="reference internal" href="../faq.html#feature-requests">Feature Requests</a></li>
<li class="toctree-l2"><a class="reference internal" href="../faq.html#contributions">Contributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../faq.html#documentation">Documentation</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../about.html">About</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../about.html#product-name">Python Slack SDK</a></li>
</ul>
</li>
</ul>


<div id="footer">

        <ul id="footer_nav">
                <li><a href="https://github.com/SlackAPI/python-slack-sdk/blob/main/LICENSE">License</a></li>
                <li><a href="https://slackhq.github.io/code-of-conduct">Code of Conduct</a></li>
                <li><a href="https://github.com/slackapi/python-slack-sdk/blob/main/.github/contributing.md">Contributing</a></li>
                <li><a href="https://docs.google.com/a/slack-corp.com/forms/d/e/1FAIpQLSfzjVoCM7ohBnjWf7eDYQxzti1EPpinsIJQA5RAUBwJKRUQHg/viewform">Contributor License Agreement</a></li>
        </ul>

        <p id="footer_signature">Made with <i class="ts_icon ts_icon_heart"></i> by Slack<br/>and our Lovely
                Community
        </p>
</div> 
                    </div>
                </nav>
                <!-- /Sidebar Content -->

                <!-- Body Content -->
                <div class="col span_3_of_4">
                    <!-- <div class="section-title">Migration Guide</div> -->
                    <div class="card">
  <section id="migration-guide">
<h1>Migration Guide<a class="headerlink" href="#migration-guide" title="Link to this heading">¶</a></h1>
<p>The v2 website is live <a class="reference external" href="https://slack.dev/python-slackclient/">here</a> just like before. However, the <strong>slackclient</strong> project is in maintenance mode now and this <strong>slack_sdk</strong> project is the successor.</p>
<section id="from-slackclient-2-x">
<h2>From slackclient 2.x<a class="headerlink" href="#from-slackclient-2-x" title="Link to this heading">¶</a></h2>
<p>There are a few changes introduced in v3.0:</p>
<ul class="simple">
<li><p>The PyPI project is renamed from <code class="docutils literal notranslate"><span class="pre">slackclient</span></code> to <code class="docutils literal notranslate"><span class="pre">slack_sdk</span></code></p></li>
<li><p>Importing <code class="docutils literal notranslate"><span class="pre">slack_sdk.*</span></code> is recommended. You can still use <code class="docutils literal notranslate"><span class="pre">slack.*</span></code> with deprecation warnings for a while.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">slack_sdk</span></code> has no required dependencies. This means <code class="docutils literal notranslate"><span class="pre">aiohttp</span></code> is no longer automatically resolved.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">WebClient</span></code> no longer has <code class="docutils literal notranslate"><span class="pre">run_async</span></code> and <code class="docutils literal notranslate"><span class="pre">aiohttp</span></code> specific options. If you still need the option or other <code class="docutils literal notranslate"><span class="pre">aiohttp</span></code> specific options, use <code class="docutils literal notranslate"><span class="pre">LegacyWebClient</span></code> (<code class="docutils literal notranslate"><span class="pre">slackclient</span></code> v2 compatible) or <code class="docutils literal notranslate"><span class="pre">AsyncWebClient</span></code>.</p></li>
</ul>
<p>We’re sorry for the inconvenience.</p>
<hr class="docutils" />
<p><strong>Change:</strong> The PyPI project is renamed from <code class="docutils literal notranslate"><span class="pre">slackclient</span></code> to <code class="docutils literal notranslate"><span class="pre">slack_sdk</span></code></p>
<p><strong>Action</strong>: Remove <code class="docutils literal notranslate"><span class="pre">slackclient</span></code>, add <code class="docutils literal notranslate"><span class="pre">slack_sdk</span></code> in <code class="docutils literal notranslate"><span class="pre">requirements.txt</span></code></p>
<p>Since v3, the PyPI project name is <a class="reference external" href="https://pypi.org/project/slack_sdk/">slack_sdk</a> (technically <code class="docutils literal notranslate"><span class="pre">slack-sdk</span></code> also works).</p>
<p>The biggest reason for the renaming is the feature coverage in v3 and newer. The SDK v3 provides not only API clients but also other modules. As the first step, it starts supporting OAuth flow out-of-the-box. The secondary reason is to make the names more consistent. The renaming addresses the long-lived confusion between the PyPI project and package names.</p>
<hr class="docutils" />
<p><strong>Change:</strong> Importing <code class="docutils literal notranslate"><span class="pre">slack_sdk.*</span></code> is recommended. You can still use <code class="docutils literal notranslate"><span class="pre">slack.*</span></code> with deprecation warnings for a while.</p>
<p><strong>Action</strong>: Replace <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">slack</span> <span class="pre">import</span></code>, <code class="docutils literal notranslate"><span class="pre">import</span> <span class="pre">slack</span></code>, and so on in your source code.</p>
<p>Most imports can be simply replaced by <code class="docutils literal notranslate"><span class="pre">find</span> <span class="pre">your_app</span> <span class="pre">-name</span> <span class="pre">'*.py'</span> <span class="pre">|</span> <span class="pre">xargs</span> <span class="pre">sed</span> <span class="pre">-i</span> <span class="pre">''</span> <span class="pre">'s/from</span> <span class="pre">slack</span> <span class="pre">/from</span> <span class="pre">slack_sdk</span> <span class="pre">/g'</span></code> or something similar. If you use <code class="docutils literal notranslate"><span class="pre">slack.web.classes.*</span></code>, the conversion is not so simple that we recommend manually replacing imports for those.</p>
<p>That said, all existing code can be migrated to v3 without any code changes. If you don’t have time for it, you can use <code class="docutils literal notranslate"><span class="pre">slack</span></code> package with deprecation warnings saying <code class="docutils literal notranslate"><span class="pre">UserWarning:</span> <span class="pre">slack</span> <span class="pre">package</span> <span class="pre">is</span> <span class="pre">deprecated.</span> <span class="pre">Please</span> <span class="pre">use</span> <span class="pre">slack_sdk.web/webhook/rtm</span> <span class="pre">package</span> <span class="pre">instead.</span> <span class="pre">For</span> <span class="pre">more</span> <span class="pre">info,</span> <span class="pre">go</span> <span class="pre">to</span> <span class="pre">https://slack.dev/python-slack-sdk/v3-migration/</span></code> for a while. We won’t remove the compatibility in the short term.</p>
<hr class="docutils" />
<p><strong>Change:</strong> <code class="docutils literal notranslate"><span class="pre">slack_sdk</span></code> has no required dependencies. This means <code class="docutils literal notranslate"><span class="pre">aiohttp</span></code> is no longer automatically resolved.</p>
<p><strong>Action</strong>: Add <code class="docutils literal notranslate"><span class="pre">aiohttp</span></code> to <code class="docutils literal notranslate"><span class="pre">requirements.txt</span></code> if you use any of <code class="docutils literal notranslate"><span class="pre">AsyncWebClient</span></code>, <code class="docutils literal notranslate"><span class="pre">AsyncWebhookClient</span></code>, and <code class="docutils literal notranslate"><span class="pre">LegacyWebClient</span></code></p>
<p>If you use some modules that require <code class="docutils literal notranslate"><span class="pre">aiohttp</span></code>, your <code class="docutils literal notranslate"><span class="pre">requirements.txt</span></code> needs to explicitly have <code class="docutils literal notranslate"><span class="pre">aiohttp</span></code>. The <code class="docutils literal notranslate"><span class="pre">slack_sdk</span></code> dependency doesn’t resolve it for you, unlike <code class="docutils literal notranslate"><span class="pre">slackclient</span></code> v2.</p>
<hr class="docutils" />
<p><strong>Change:</strong> <code class="docutils literal notranslate"><span class="pre">WebClient</span></code> no longer has <code class="docutils literal notranslate"><span class="pre">run_async</span></code> and <code class="docutils literal notranslate"><span class="pre">aiohttp</span></code> specific options.</p>
<p><strong>Action:</strong> If you still need the option or other <code class="docutils literal notranslate"><span class="pre">aiohttp</span></code> specific options, use <code class="docutils literal notranslate"><span class="pre">LegacyWebClient</span></code> (<code class="docutils literal notranslate"><span class="pre">slackclient</span></code> v2 compatible) or <code class="docutils literal notranslate"><span class="pre">AsyncWebClient</span></code>.</p>
<p>The new <code class="docutils literal notranslate"><span class="pre">slack_sdk.web.WebClient</span></code> doesn’t rely on <code class="docutils literal notranslate"><span class="pre">aiohttp</span></code> internally at all. The class provides only the synchronous way to call Web APIs. If you need a v2 compatible one, you can use <code class="docutils literal notranslate"><span class="pre">LegacyWebClient</span></code>. Apart from the name, there is no breaking change in the class.</p>
<p>If you’re using <code class="docutils literal notranslate"><span class="pre">run_async=True</span></code> option, we highly recommend switching to <code class="docutils literal notranslate"><span class="pre">AsyncWebClient</span></code>. <code class="docutils literal notranslate"><span class="pre">AsyncWebClient</span></code> is a straight-forward async HTTP client. You can expect the class properly works in the nature of <code class="docutils literal notranslate"><span class="pre">async/await</span></code> provided by the standard <code class="docutils literal notranslate"><span class="pre">asyncio</span></code> library.</p>
</section>
<section id="from-slackclient-1-x">
<h2>From slackclient 1.x<a class="headerlink" href="#from-slackclient-1-x" title="Link to this heading">¶</a></h2>
<p>Refer to <a class="reference external" href="https://github.com/slackapi/python-slack-sdk/wiki/Migrating-to-2.x">the migration guide</a>.</p>
</section>
</section>


                        <div class="clear_both large_bottom_margin"></div>
                    </div>
                </div>
                <!-- /Body Content -->
            </div>
        </div>

        <footer>
            <p class="light tiny align_center">
                © 2015- Slack Technologies, LLC and contributors
            </p>
        </footer>

        <script>
            window.ga =
                window.ga ||
                function() {
                    (ga.q = ga.q || []).push(arguments);
                };
            ga.l = +new Date();
            ga('create', 'UA-56978219-13', 'auto');
            ga('send', 'pageview');
        </script>
        <script async src="https://www.google-analytics.com/analytics.js"></script>
    </body>
</html>